import request from './request'

// 获取聊天内容
export function getMsgContent(data) {
  let url = ''
  if(!data.filter){
    url = `/index/getMsgContents?order=desc&limit=${data.limit ? data.limit : '20'}&offset=${data.offset}&sort=${data.sort}&type=${data.type}&z_wxid=${data.z_wxid}&to_wxid=${data.to_wxid}`
  } else{
    url = `/index/getMsgContents?filter=${JSON.stringify(data.filter)}&op=${JSON.stringify(data.op)}&order=desc&limit=${data.limit ? data.limit : '20'}&offset=${data.offset}&sort=${data.sort}`
  }
  return request({
    url,
    method: 'get'
  })
}
// 获取用户信息
export function getUserInfo(data) {
  return request({
    url: `/index/getMsgUser?filter=${JSON.stringify(data.filter)}&op=${JSON.stringify(data.op)}&limit=10&offset=${data.offset}&type=${data.type}&to_wxid=${data.to_wxid}`,
    method: 'get'
  })
}